%{
#define YY_NO_UNISTD_H
#include "Parserbase.h"
#include "AnalyzersExtra.h"

%}

%option outfile="Scanner.cpp" header-file="Scanner.h"
%option c++ 8bit warn yywrap yylineno

DIGIT		[0-9]
ALPHA		[A-Za-z]
ALPHANUM	{ALPHA}({DIGIT}|{ALPHA})*
ID 		{ALPHA}+{DIGIT}*
BODYTEXT            \{*\}

  /* FOPEN		\{ */
  /* FCLOSE		\} */
  /* STMT		{ID} : ({ID}|{DIGIT}|{ALPHANUM})+ */
  /* CLASS 		{ID}{FOPEN}{FCLOSE} */
%%

{DIGIT}*\.?{DIGIT}+ {
  std::cerr << "\e[1;34mreturning NUMBER\e[m" << std::endl;
  return Parser::NUMBER;
}

\n|; {
  std::cerr << "\e[1;34mreturning CMD_END\e[m" << std::endl;
  return Parser::CMD_END;
}

[ \t]+ {
  std::cerr << "returning nothing" << std::endl;
}

  /*{CLASS} {
    std::cerr << "\e[1;34mreturning class: \'" << yytext << std::endl;
    return Parser::CLASS;
  }*/

import {
return Parser::IMPORT;
}

function {
return Parser::FUNC;
}

BODYTEXT {
    return Parser::BTEXT;
}

{ID} {
  stack->append(yytext);
  return Parser::ID;
}




. {
  std::cerr << "\e[1;34mreturning misc: \'" << yytext[0] << "\': [" << int(yytext[0]) << "]\e[m" << std::endl;
  return yytext[0];
}




%%

int yyFlexLexer::yywrap()
{
  return 1;
}

// int main()
// {
//   yyFlexLexer l;
//   return l.yylex();
// }
